﻿<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Cwgl_CancelExportPz.aspx.vb" Inherits="Slxt.Cwgl_CancelExportPz"%>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css">
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/_nav/menu.js"></script>
		<script language="javascript" src="/PubProject/Js/Public.js"></script>	
		
		<script language="javascript">
		 //取消生成凭证
		    function CancelCreateCwPz()
		    {
		        var sReturn;
		        var sFilter;
		        
		        if (!window.confirm("确认要对单据列表中显示的单据进行取消生成凭证操作吗？"))
                {
                    return;
                }                        
		        
		        sFilter = document.all("txtGUIDs").value;
		        
                // 选中行对象数组
	            var arrTr = appGrid.frameElement.getAllRows();
	            if (!arrTr) return;
		        
            	for(i=0;i<arrTr.length;i++)
            	{
            	    if(sFilter=="")
            	    {
            	        sFilter += "'" + arrTr[i].oid+"'";
            	    }
            	    else
            	    {
            	        sFilter += ",'" + arrTr[i].oid+"'";
            	    }
            	}
            	
            	if (sFilter.length>200)
                { 
                    //大容量数据，先存在Session中：CbCwjkFilter是Session名
                    GetDataFromXMLHTTP("/Cbgl/PUB/Pub_XMLHTTP.aspx","SaveSession","","SlCwjkFilter",sFilter);
                }
                
		        //取消已生成的凭证
                sReturn = GetDataFromXMLHTTP("/PubProject/Cwjk/Pzgl_XMLHTTP.aspx", "CancelExportPz", "", "", sFilter);
		    
		        if (sReturn == "OK")
		        {
		            parent.window.returnValue='AlreadyCancelledPZ';
		            parent.window.close();
		        }
		        else
		        {
		            parent.window.returnValue='Error';
		            parent.window.close();
		        }
		        
		    }
		 </script>   
		 
	</HEAD>
	<body MS_POSITIONING="GridLayout"  style="margin-top:15px;margin-left:15px; margin-right:15px">
	    <form id="Form1" method="post" runat="server">
		<asp:textbox id="txtGUIDs" runat="server" style="DISPLAY:none"></asp:textbox>
		
		<table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
		    <tr height="40">
				<td class="header">
					<div class="header"></div>					
					<span style="PADDING-LEFT:8px">当前选择单据所生成的凭证中包含了以下其它单据：</span>
					<br>
					<span style="PADDING-LEFT:8px">点击“取消生成凭证”则会将列表中的单据全部取消生成凭证，并删除对应的凭证记录。</span>
					<br>
					<span style="PADDING-LEFT:8px">点击“关闭”则会直接关闭当前窗口。</span>
				</td>
			</tr>
			<tr>
				<td>
					<table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
						<tr height="1">
							<td>
								<mnu:AppGridMenu id="appGridMenu" runat="server" />
							</td>
						</tr>
						<tr>
							<td>
								<cnt:AppGrid id="appGrid" runat="server" multiselect="false" Filter="<filter/>" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr height="40"  id="trsp">
					<td class="buttons" colSpan="2">
					    <button style="width:100px" id="CancelCreatePz" onclick="CancelCreateCwPz();" type="button">取消生成凭证</button>&nbsp;&nbsp; <button onclick="parent.window.returnValue='Cancel';parent.window.close();" id="btnCancel" type="button">
							关 闭</button>
					</td>
				</tr>
		</table>
		</form>
	</body>
</HTML>